﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex1.ExtensionMethodSubstring
{
    public static class Extensions
    {
        public static StringBuilder Substring (this StringBuilder builder,int index,int length)
        {
            return new StringBuilder(builder.ToString().Substring(index,length));
        }
    }

    class ExtensionMethodSubstring
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder("somestring");
            sb = sb.Substring(4, 6);
            Console.WriteLine(sb.ToString());
        }
    }
}
